<%--
  Created by IntelliJ IDEA.
  User: hahxixi
  Date: 2024/11/3
  Time: 下午3:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <style>
        .layui-table{
            width: 800px ;
            margin: 0 auto ;
        }
    </style>
</head>
<body>
<p>
<form action="1" method="post">
    <div class="layui-input-inline layui-input-wrap">
        <input type="tel" name="studentNum" value="${student.studentNum}" placeholder="请输入学号" autocomplete="off"  lay-affix="clear" class="layui-input demo-phone">
    </div>
    <br>
    <div class="layui-input-inline layui-input-wrap">
        <input type="tel" name="studentName" value="${student.studentName}" placeholder="请输入学生姓名"  autocomplete="off"  lay-affix="clear" class="layui-input demo-phone">
    </div>
    <br>
    <div class="layui-input-inline layui-input-wrap">
        <input type="text" name="classId" value="${student.classId}" placeholder="请输入班级"  autocomplete="off"  lay-affix="clear" class="layui-input demo-phone">
    </div>
    <br>
    <div class="layui-input-inline layui-input-wrap">
        <input type="text" name="hostelId" value="${student.hostelId}" placeholder="请输入宿舍号"  autocomplete="off"  lay-affix="clear" class="layui-input demo-phone">
    </div>
    <div class="layui-form layui-row layui-col-space16">
        <div class="layui-col-md6">
            <div class="layui-form-item">
                <div class="layui-input-inline layui-input-wrap">
                    <select name="status" style="width: 100%;">
                        <option value="" ${student.status == null ? 'selected' : ''}>请选择学生状态</option>
                        <option value="0" ${student.status == 0 ? 'selected' : ''}>在读</option>
                        <option value="1" ${student.status == 1 ? 'selected' : ''}>毕业</option>
                    </select>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-form layui-row layui-col-space16">
        <div class="layui-col-md6">
            <div class="layui-form-item">
                <div class="layui-input-inline layui-input-wrap">
                    <select name="delFlag" style="width: 100%;">
                        <option value="" ${student.delFlag == null ? 'selected' : ''}>请选择删除状态</option>
                        <option value="0" ${student.delFlag == 0 ? 'selected' : ''}>存在</option>
                        <option value="1" ${student.delFlag == 1 ? 'selected' : ''}>删除</option>
                    </select>
                </div>
            </div>
        </div>
    </div>
    <br>
    <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">查询</button>
    <a class="layui-btn layui-btn-danger" href="/student/toadd" style="text-decoration: none">添加学生</a><br>
</form>
</p>
<table class="layui-table" lay-even>
    <colgroup>
        <col width="150">
        <col width="150">
        <col>
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>&nbsp;编号&nbsp;</th>
        <th>&nbsp;学号&nbsp;</th>
        <th>&nbsp;姓名&nbsp;</th>
        <th>&nbsp;性别&nbsp;</th>
        <th>&nbsp;年龄&nbsp;</th>
        <th>出生日期</th>
        <th>&nbsp;班级&nbsp;</th>
        <th>&nbsp;宿舍&nbsp;</th>
        <th>&nbsp;电话&nbsp;</th>
        <th>&nbsp;邮箱&nbsp;</th>
        <th>家庭地址</th>
        <th>紧急联系人</th>
        <th>紧急电话</th>
        <th>&nbsp;专业&nbsp;</th>
        <th>学生状态</th>
        <th>删除标志</th>
        <th>创建者</th>
        <th>创建时间</th>
        <th>更新者</th>
        <th>更新时间</th>
        <th>备注</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${students}" var="student">
        <tr>
            <td>${student.sId}</td>
            <td>${student.studentNum}</td>
            <td>${student.studentName}</td>
            <td><c:if test="${student.gender==0}">男</c:if><c:if test="${student.gender==1}">女</c:if></td>
            <td>${student.age}</td>
            <td><fmt:formatDate value="${student.birthday}" pattern="yyyy-MM-dd"/></td>
            <td>${student.classId}</td>
            <td>${student.hostelId}</td>
            <td>${student.phone}</td>
            <td>${student.email}</td>
            <td>${student.homeAddress}</td>
            <td>${student.emergencyContact}</td>
            <td>${student.emergencyContactPhone}</td>
            <td>${student.major}</td>
            <td><c:if test="${student.status==0}">在读</c:if><c:if test="${student.status==1}">毕业</c:if></td>
            <td><c:if test="${student.delFlag==0}">存在</c:if><c:if test="${student.delFlag==1}">删除</c:if></td>
            <td>${student.createBy}</td>
            <td><fmt:formatDate value="${student.createTime}" pattern="yyyy-MM-dd"/></td>
            <td>${student.updateBy}</td>
            <td><fmt:formatDate value="${student.updateTime}" pattern="yyyy-MM-dd"/></td>
            <td>${student.remark}</td>
            <td>
                <a class="layui-btn layui-btn-xs" href="/student/toupdate/${student.sId}">修改</a>
                <br>
                <a class="layui-btn layui-btn-danger layui-btn-xs" href="/student/delete/${student.sId}">删除</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="21" style="text-align: center">
            <a class="layui-btn layui-btn-xs" href="1">首页</a>
            <c:if test="${page.currentPage!=1}">
                <a class="layui-btn layui-btn-xs" href="${page.currentPage-1}">上一页</a>
            </c:if>
            &nbsp;&nbsp;当前页数：${page.currentPage}/${page.totalPage}&nbsp;&nbsp;
            <c:if test="${page.currentPage!=totalPage}">
                <a class="layui-btn layui-btn-xs" href="${page.currentPage+1}">下一页</a>
            </c:if>
            <a class="layui-btn layui-btn-xs" href="${page.totalPage}">尾页</a>
        </td>
    </tr>
    </tbody>
</table>
</body>
<script src="/static/layui/layui.js"></script>
</html>
